﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Entities;
using BLL;
using System.IO;
namespace Stationery
{
    public partial class Info : BasePage
    {
        BLL_MenuURL bll_MenuURL = new BLL_MenuURL();
        MenuURL menuURL = new MenuURL();

        protected void Page_Load(object sender, EventArgs e)
        {
            string strID = "";
            if (Request.Params["id"] != null)
            {
                strID = Request.Params["id"].ToString();
            }

            switch (strID)
            {
                case Utils.menu_intro:
                    LabelTitle.Text = Utils.label_intro;
                    menuURL = bll_MenuURL.Lst_MenuURL(bll_MenuURL.Get_MenuURL_Dynamic(String.Format("CODE='{0}'", Utils.menu_intro)))[0];
                    break;
                case Utils.menu_contact:
                    LabelTitle.Text = Utils.label_contact;
                    menuURL = bll_MenuURL.Lst_MenuURL(bll_MenuURL.Get_MenuURL_Dynamic(String.Format("CODE='{0}'", Utils.menu_contact)))[0];
                    control.Controls.Add(Page.LoadControl("UC/UC_Contact.ascx"));
                    break;
                case Utils.menu_place:
                    LabelTitle.Text = Utils.label_place;
                    menuURL = bll_MenuURL.Lst_MenuURL(bll_MenuURL.Get_MenuURL_Dynamic(String.Format("CODE='{0}'", Utils.menu_place)))[0];
                    break;
                case Utils.menu_service:
                    LabelTitle.Text = Utils.label_service;
                    menuURL = bll_MenuURL.Lst_MenuURL(bll_MenuURL.Get_MenuURL_Dynamic(String.Format("CODE='{0}'", Utils.menu_service)))[0];
                    break;
                case Utils.menu_guide:
                    LabelTitle.Text = Utils.label_guide;
                    menuURL = bll_MenuURL.Lst_MenuURL(bll_MenuURL.Get_MenuURL_Dynamic(String.Format("CODE='{0}'", Utils.menu_guide)))[0];
                    break;
                case Utils.menu_process:
                    LabelTitle.Text = Utils.label_process;
                    menuURL = bll_MenuURL.Lst_MenuURL(bll_MenuURL.Get_MenuURL_Dynamic(String.Format("CODE='{0}'", Utils.menu_process)))[0];
                    break;
                default:
                    LabelTitle.Text = Utils.label_intro;
                    menuURL = bll_MenuURL.Lst_MenuURL(bll_MenuURL.Get_MenuURL_Dynamic(String.Format("CODE='{0}'", Utils.menu_intro)))[0];
                    break;
            }
            try
            {
                LabelHandscript.Text = menuURL.DESCRIPTION;
            }
            catch 
            {
                LabelHandscript.Text = "";
            }
        }
    }
}
